home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 April / ME_2011_04.iso / [Video-Tutorial] / start.swf / scripts / frame_1 / DoAction_6.as < prev    next >
Encoding:
Text File  |  2010-10-14  |  12.5 KB  |  455 lines

  1. function setWindowInterfacePos()
  2. {
  3.    faktor1 = Stage.width / bg_mc._width;
  4.    faktor2 = Stage.height / bg_mc._height;
  5.    if(faktor1 > faktor2)
  6.    {
  7.       ratio = faktor1;
  8.    }
  9.    else
  10.    {
  11.       ratio = faktor2;
  12.    }
  13.    bg_mc._width *= ratio;
  14.    bg_mc._height *= ratio;
  15.    size_mc._x = Math.round(Stage.width - 14);
  16.    size_mc._y = Math.round(Stage.height - 14);
  17.    application_border_mc._width = Stage.width - 1;
  18.    application_border_mc._height = Stage.height - 1;
  19.    if(!live_mode)
  20.    {
  21.       dragbar_mc._width = Stage.width;
  22.    }
  23.    tools_mc._x = Stage.width - 53;
  24.    html_fs_btn._x = Stage.width - 26;
  25. }
  26. function setPos()
  27. {
  28.    stage_width = Stage.width;
  29.    stage_height = Stage.height;
  30.    content_pos_mc.tab_navigation_mc.tab_navigation_bg_mc._visible = true;
  31.    if(_root.useFSP_path == "false")
  32.    {
  33.       var _loc2_ = 25;
  34.    }
  35.    else
  36.    {
  37.       application_title_op._visible = true;
  38.       if(stage_height > minimum_stage_height)
  39.       {
  40.          _loc2_ = 49;
  41.       }
  42.       else if(live_mode)
  43.       {
  44.          _loc2_ = 49;
  45.       }
  46.       else
  47.       {
  48.          _loc2_ = 25;
  49.       }
  50.    }
  51.    if(live_mode)
  52.    {
  53.       content_bg_width = Number(livemode_width);
  54.       content_bg_height = Number(livemode_height);
  55.       content_pos_mc.content_bg_mc._y = -25;
  56.    }
  57.    else if(fullscreen)
  58.    {
  59.       content_bg_width = stage_width;
  60.       content_bg_height = stage_height;
  61.       content_pos_mc.content_bg_mc._y = 0;
  62.    }
  63.    else
  64.    {
  65.       content_bg_width = stage_width;
  66.       content_bg_height = stage_height;
  67.       if(video_mode && full_video_mode_display == "true")
  68.       {
  69.          content_pos_mc.content_bg_mc._y = 0;
  70.       }
  71.       else
  72.       {
  73.          content_pos_mc.content_bg_mc._y = 25;
  74.       }
  75.       if(stage_width > Number(default_stage_width))
  76.       {
  77.          content_bg_width = Number(default_stage_width);
  78.       }
  79.       if(stage_height > Number(default_stage_height))
  80.       {
  81.          content_bg_height = Number(default_stage_height);
  82.       }
  83.       if(stage_width < Number(minimum_stage_width))
  84.       {
  85.          content_bg_width = Number(minimum_stage_width);
  86.       }
  87.       if(stage_height < Number(minimum_stage_height))
  88.       {
  89.          content_bg_height = Number(minimum_stage_height);
  90.       }
  91.    }
  92.    content_pos_mc.content_bg_mc._width = content_bg_width;
  93.    if(fullscreen)
  94.    {
  95.       content_pos_mc.content_bg_mc._height = content_bg_height;
  96.    }
  97.    else if(live_mode)
  98.    {
  99.       content_pos_mc.content_bg_mc._height = content_bg_height + 2;
  100.    }
  101.    else if(video_mode && full_video_mode_display == "true")
  102.    {
  103.       content_pos_mc.content_bg_mc._height = content_bg_height - _loc2_ + 25;
  104.    }
  105.    else
  106.    {
  107.       content_pos_mc.content_bg_mc._height = content_bg_height - _loc2_;
  108.    }
  109.    content_pos_x = Math.round(stage_width / 2 - content_bg_width / 2);
  110.    if(content_pos_x < 0)
  111.    {
  112.       content_pos_x = 0;
  113.    }
  114.    content_pos_y = Math.round(stage_height / 2 - content_bg_height / 2);
  115.    if(_root.useFSP_path == "false")
  116.    {
  117.       if(content_pos_y < 0)
  118.       {
  119.          content_pos_y = 0;
  120.       }
  121.    }
  122.    else if(fullscreen)
  123.    {
  124.       if(content_pos_y < 0)
  125.       {
  126.          content_pos_y = 0;
  127.       }
  128.       dragbar_mc._height = 23;
  129.    }
  130.    else if(live_mode)
  131.    {
  132.       content_pos_y = 25;
  133.       dragbar_mc._height = 25;
  134.    }
  135.    else
  136.    {
  137.       if(content_pos_y < 24)
  138.       {
  139.          content_pos_y = 24;
  140.       }
  141.       dragbar_mc._height = 23;
  142.    }
  143.    content_pos_mc._x = content_pos_x;
  144.    content_pos_mc._y = content_pos_y;
  145.    content_pos_mc.content_panel_mc._width = content_bg_width - 4;
  146.    if(video_mode)
  147.    {
  148.       if(live_mode)
  149.       {
  150.          content_pos_mc.content_panel_mc._y = 2;
  151.          content_pos_mc.video_mc._y = 2;
  152.          content_pos_mc.content_panel_mc._height = content_bg_height - _loc2_ - 4;
  153.       }
  154.       else if(fullscreen)
  155.       {
  156.          content_pos_mc.content_panel_mc._y = 2;
  157.          content_pos_mc.video_mc._y = 2;
  158.          content_pos_mc.content_panel_mc._height = content_bg_height - 29;
  159.       }
  160.       else if(full_video_mode_display == "true")
  161.       {
  162.          content_pos_mc.content_panel_mc._y = 27;
  163.          content_pos_mc.video_mc._y = 27;
  164.          content_pos_mc.content_panel_mc._height = content_bg_height - 29 - _loc2_;
  165.       }
  166.       else
  167.       {
  168.          content_pos_mc.content_panel_mc._y = 52;
  169.          content_pos_mc.video_mc._y = 52;
  170.          content_pos_mc.content_panel_mc._height = content_bg_height - 54 - _loc2_;
  171.       }
  172.    }
  173.    else
  174.    {
  175.       content_pos_mc.content_panel_mc._y = 27;
  176.       content_pos_mc.content_panel_mc._height = content_bg_height - 61 - _loc2_;
  177.    }
  178.    if(saved_panel_width != content_pos_mc.content_panel_mc._width or saved_panel_height != content_pos_mc.content_panel_mc._height)
  179.    {
  180.       if(saved_stage_width != Stage.width or saved_stage_height != Stage.height)
  181.       {
  182.          setpos_changelog++;
  183.       }
  184.       content_pos_mc.content_panel_mc.broadcastMessage("onCustomResize");
  185.    }
  186.    saved_stage_width = Stage.width;
  187.    saved_stage_height = Stage.height;
  188.    saved_panel_width = content_pos_mc.content_panel_mc._width;
  189.    saved_panel_height = content_pos_mc.content_panel_mc._height;
  190.    content_pos_mc.bottom_mc.bottom_bg_mc._width = content_pos_mc.content_panel_mc._width;
  191.    content_pos_mc.bottom_mc._x = 2;
  192.    content_pos_mc.bottom_mc._y = content_pos_mc.content_panel_mc._y + content_pos_mc.content_panel_mc._height + 2;
  193.    content_pos_mc.bottom_mc.logo_bottom_holder_mc._x = content_pos_mc.bottom_mc.bottom_bg_mc._width - content_pos_mc.bottom_mc.logo_bottom_holder_mc._width - 10;
  194.    content_pos_mc.bottom_mc.logo_bottom_holder_mc._y = Math.round(content_pos_mc.bottom_mc.bottom_bg_mc._height / 2 - content_pos_mc.bottom_mc.logo_bottom_holder_mc._height / 2) - 3;
  195.    if(special_pos_mc.inlay_video_mc)
  196.    {
  197.       special_pos_mc.inlay_video_mc.setLocalPos();
  198.       inlay_video_mc_x = Math.round(Stage.width / 2 - special_pos_mc.inlay_video_mc._width / 2);
  199.       inlay_video_mc_y = Math.round(Stage.height / 2 - special_pos_mc.inlay_video_mc._height / 2);
  200.       if(inlay_video_mc_x <= 0)
  201.       {
  202.          inlay_video_mc_x = 0;
  203.       }
  204.       if(_root.useFSP_path == "true")
  205.       {
  206.          if(inlay_video_mc_y < 24)
  207.          {
  208.             inlay_video_mc_y = 24;
  209.          }
  210.       }
  211.       else if(inlay_video_mc_y <= 0)
  212.       {
  213.          inlay_video_mc_y = 0;
  214.       }
  215.       special_pos_mc.inlay_video_mc._x = inlay_video_mc_x;
  216.       special_pos_mc.inlay_video_mc._y = inlay_video_mc_y;
  217.    }
  218. }
  219. function maximizeApplication()
  220. {
  221.    if(maximized)
  222.    {
  223.       tools_mc.gotoAndStop(1);
  224.       if(client_os == "Windows")
  225.       {
  226.          mdm.Forms.MainForm.restore();
  227.       }
  228.       else
  229.       {
  230.          mdm.Forms.MainForm.showFullScreen(false);
  231.       }
  232.       application_border_mc._visible = true;
  233.       maximized = false;
  234.       size_mc._visible = true;
  235.       if(saved_premaximize_width == undefined || saved_premaximize_width == client_res_x)
  236.       {
  237.          mdm.Forms.MainForm.width = client_res_x - 20;
  238.          mdm.Forms.MainForm.height = client_res_y - 20 - mac_margin;
  239.          mdm.Forms.MainForm.x = Math.round(client_res_x / 2 - mdm.Forms.MainForm.width / 2);
  240.          mdm.Forms.MainForm.y = Math.round(client_res_y / 2 - mdm.Forms.MainForm.height / 2);
  241.       }
  242.    }
  243.    else
  244.    {
  245.       tools_mc.gotoAndStop(2);
  246.       application_border_mc._visible = false;
  247.       saved_premaximize_width = mdm.Forms.MainForm.width;
  248.       saved_premaximize_height = mdm.Forms.MainForm.height;
  249.       if(client_os == "Windows")
  250.       {
  251.          mdm.Forms.MainForm.maximize();
  252.       }
  253.       else
  254.       {
  255.          mdm.Forms.MainForm.showFullScreen(true);
  256.       }
  257.       maximized = true;
  258.       size_mc._visible = false;
  259.    }
  260.    setPos();
  261. }
  262. function minimizeApplication()
  263. {
  264.    if(client_os == "Windows")
  265.    {
  266.       mdm.Forms.MainForm.minimize();
  267.    }
  268.    else if(maximized)
  269.    {
  270.       maximizeApplication();
  271.       macminimize_delay = setTimeout(macMinimize,250);
  272.    }
  273.    else
  274.    {
  275.       macMinimize();
  276.    }
  277. }
  278. function macMinimize()
  279. {
  280.    mdm.Forms.MainForm.minimize();
  281. }
  282. function openApplication()
  283. {
  284.    if(_root.useFSP_path != "true")
  285.    {
  286.       activateHtmlFsbtn();
  287.    }
  288.    if(client_os == "Windows")
  289.    {
  290.       mdm.Forms.SplashForm.callFunction("output","Opening..","");
  291.    }
  292.    if(saved_app_resolution_x)
  293.    {
  294.       var _loc3_ = saved_app_resolution_x;
  295.    }
  296.    else
  297.    {
  298.       _loc3_ = client_res_x;
  299.    }
  300.    if(saved_app_resolution_y)
  301.    {
  302.       var _loc2_ = saved_app_resolution_y;
  303.    }
  304.    else
  305.    {
  306.       _loc2_ = client_res_y - mac_margin;
  307.    }
  308.    if(_loc3_ > client_res_x)
  309.    {
  310.       _loc3_ = client_res_x;
  311.    }
  312.    if(_loc2_ > client_res_y)
  313.    {
  314.       _loc2_ = client_res_y - mac_margin;
  315.    }
  316.    if(_loc3_ == client_res_x && _loc2_ == client_res_y)
  317.    {
  318.       mdm.Forms.MainForm.width = client_res_x - 20;
  319.       mdm.Forms.MainForm.height = client_res_y - 20 - mac_margin;
  320.       main_form_x = Math.round(client_res_x / 2 - mdm.Forms.MainForm.width / 2);
  321.       main_form_y = Math.round(client_res_y / 2 - mdm.Forms.MainForm.height / 2);
  322.       if(main_form_x <= 0)
  323.       {
  324.          main_form_x = 0;
  325.       }
  326.       if(main_form_y <= 0)
  327.       {
  328.          main_form_y = 0;
  329.       }
  330.       mdm.Forms.MainForm.x = main_form_x;
  331.       mdm.Forms.MainForm.y = main_form_y;
  332.       maximizeApplication();
  333.    }
  334.    else
  335.    {
  336.       mdm.Forms.MainForm.width = _loc3_;
  337.       mdm.Forms.MainForm.height = _loc2_;
  338.       main_form_x = Math.round(client_res_x / 2 - _loc3_ / 2);
  339.       main_form_y = Math.round(client_res_y / 2 - _loc2_ / 2);
  340.       if(main_form_x <= 0)
  341.       {
  342.          main_form_x = 0;
  343.       }
  344.       if(main_form_y <= 0)
  345.       {
  346.          main_form_y = 0;
  347.       }
  348.       mdm.Forms.MainForm.x = main_form_x;
  349.       mdm.Forms.MainForm.y = main_form_y;
  350.    }
  351.    setPos();
  352.    mdm.Forms.MainForm.visible = true;
  353.    if(client_os == "Windows")
  354.    {
  355.       mdm.Forms.SplashForm.callFunction("output","Initialising","");
  356.    }
  357.    mdm.Forms.SplashForm.close();
  358.    clearInterval(main_timeout);
  359.    main_timeout = setTimeout(renderMain,250);
  360. }
  361. function renderExit()
  362. {
  363.    v2b_system_so.data.resultion = [mdm.Forms.MainForm.width,mdm.Forms.MainForm.height];
  364.    killInlayVideo();
  365.    content_pos_mc._visible = false;
  366.    dragbar_mc._visible = false;
  367.    tools_mc._visible = false;
  368.    size_mc._visible = false;
  369.    application_title_op._visible = false;
  370.    bg_mc._alpha = 35;
  371.    special_pos_mc._x = 0;
  372.    special_pos_mc._y = 0;
  373.    special_pos_mc.attachMovie("exit_mc","exit_mc",1);
  374.    content_pos_mc.content_mc.removeMovieClip();
  375.    content_pos_mc.video_mc.flv_player.pause();
  376. }
  377. function renderMCT(__file)
  378. {
  379.    destroyBacktoVideoButton();
  380.    video_mode = true;
  381.    mct_mode = true;
  382.    content_pos_mc.bottom_mc._visible = false;
  383.    if(full_video_mode_display == "true")
  384.    {
  385.       content_pos_mc.tab_navigation_mc._visible = false;
  386.    }
  387.    i = 0;
  388.    while(i < used_tab_arr.length)
  389.    {
  390.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc._visible = false;
  391.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].enabled = true;
  392.       if(used_tab_arr[i][2])
  393.       {
  394.          content_pos_mc.content_mc[used_tab_arr[i][1]]._visible = false;
  395.       }
  396.       i++;
  397.    }
  398.    mct_info = __file;
  399.    content_pos_mc.mct_mc.createEmptyMovieClip("mct_holder_mc",1);
  400.    loadClip(fsp_path + folder + mct_core,content_pos_mc.mct_mc.mct_holder_mc,null,null,false,false,false,false,true,true,null);
  401.    setPos();
  402. }
  403. function killMCT()
  404. {
  405.    mct_mode = false;
  406.    video_mode = false;
  407.    content_pos_mc.mct_mc.mct_holder_mc.removeMovieClip();
  408.    mct_info = undefined;
  409.    content_pos_mc.tab_navigation_mc._visible = true;
  410.    renderContent(last_visible_content);
  411.    content_pos_mc.bottom_mc._visible = true;
  412.    setPos();
  413. }
  414. function notifyDebugger(arg)
  415. {
  416.    if(debug == "true")
  417.    {
  418.       debug_mc_attached.debug_op.text += "\n" + arg;
  419.    }
  420. }
  421. function printOverview()
  422. {
  423.    my_print = new PrintJob();
  424.    var _loc2_ = my_print.start();
  425.    i = 1;
  426.    while(i <= p_num)
  427.    {
  428.       my_print.addPage("overview_mc_print" + i,null,{printAsBitmap:false},1);
  429.       i++;
  430.    }
  431.    my_print.send();
  432.    delete my_print;
  433. }
  434. function f1Handler()
  435. {
  436.    triggerHandler(_root.targetF1);
  437. }
  438. function lostHandler()
  439. {
  440.    triggerHandler(_root.targetLOST);
  441. }
  442. function triggerHandler(arg)
  443. {
  444.    i = 0;
  445.    while(i < used_tab_arr.length)
  446.    {
  447.       if(String(content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.text.toLowerCase()) == String(arg.toLowerCase()))
  448.       {
  449.          renderContent(i);
  450.          break;
  451.       }
  452.       i++;
  453.    }
  454. }
  455.